<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <style>
        div{
            width: 200px;
            height: 60px;
            background-color: #f0f0f0;
            text-align: center;
            line-height: 60px;
            cursor: pointer;
        }
    </style> -->




    <style>
        table{
            border-top:1px solid black ;
            width: 600px;
            height: 200px;
            border-collapse: collapse;
        }
        th{
            border-bottom:1px solid black ;
            width: 25%;
            height: 40px;
            background-color: rgb(241, 174, 241);
        }
        td{
            border-bottom:1px solid black ;
            text-align: center;
        }
    </style>
</head>
<body>
    <!-- <div onmouseover="one()" onmouseout="two()" id="DIV">辅导班数字</div>
    <script>
        function one(){
            const element=document.getElementById('DIV');
            element.style.backgroundColor='lightblue';
        }
        function two(){
            const element=document.getElementById('DIV');
            element.style.backgroundColor='#f0f0f0';
        }
    </script> -->


    <table >
        <thead>
            <th>学号</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>号码</th>
        </thead>
        <tbody>
            <tr>
                <td onmouseover="one(this)" onmouseout="two(this)">001</td>
                <td onmouseover="one(this)" onmouseout="two(this)">张三</td>
                <td onmouseover="one(this)" onmouseout="two(this)">23</td>
                <td onmouseover="one(this)" onmouseout="two(this)">12335896347</td>
            </tr>
            <tr>
                <td onmouseover="one(this)" onmouseout="two(this)">002</td>
                <td onmouseover="one(this)" onmouseout="two(this)">李四</td>
                <td onmouseover="one(this)" onmouseout="two(this)">20</td>
                <td onmouseover="one(this)" onmouseout="two(this)">18563302394</td>
            </tr>
            <tr>
                <td onmouseover="one(this)" onmouseout="two(this)">003</td>
                <td onmouseover="one(this)" onmouseout="two(this)">麻子</td>
                <td onmouseover="one(this)" onmouseout="two(this)">45</td>
                <td onmouseover="one(this)" onmouseout="two(this)">16583249672</td>
            </tr>
            <tr>
                <td onmouseover="one(this)" onmouseout="two(this)">004</td>
                <td onmouseover="one(this)" onmouseout="two(this)">王二</td>
                <td onmouseover="one(this)" onmouseout="two(this)">35</td>
                <td onmouseover="one(this)" onmouseout="two(this)">17896532456</td>
            </tr>
        </tbody>
    </table>
    <script>
        function one(cell){
            const row=cell.parentNode;
            const cells=row.getElementsByTagName('td');
            for(let i=0;i<cells.length;i++){
                cells[i].style.backgroundColor='lightblue';
            }
        }
        function two(cell){
            const row=cell.parentNode;
            const cells=row.getElementsByTagName('td');
            for(let i=0;i<cells.length;i++){
                cells[i].style.backgroundColor='';
            }
        }
    </script>
</body>
</html>